package com.fhnew.app.util;

import android.app.ProgressDialog;
import android.content.Context;
import android.os.Bundle;

import com.fhnew.app.R;


/**
 * Created by admin on 2018/12/5.
 */

public class BaseLoadingDialog extends ProgressDialog {
    public BaseLoadingDialog(Context context) {
        super(context);
    }

    public BaseLoadingDialog(Context context, int theme) {
        super(context, theme);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        init(getContext());
    }

    private void init(Context context) {
        setCancelable(false);
        setCanceledOnTouchOutside(false);
        setContentView(R.layout.base_progressbar);//loading的xml文件
    }

    @Override
    public void show() {//开启
        super.show();
    }

    @Override
    public void dismiss() {//关闭
        try {
            super.dismiss();
        } catch (Exception e) {
        }
    }

}
